-- GENERATED SPELL FOR [Withered Corpse] --


function spell0_20561(pUnit, Event) --@Parasite,n/a--
pUnit:FullCastSpellOnTarget(36469,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20561', 32000, 1)
end

function spell1_20561(pUnit, Event) --@Rend,n/a--
pUnit:FullCastSpellOnTarget(13443,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20561', 15000, 1)
end

function Sorts_20561(pUnit, Event)
local choix_sorts_20561 = math.random(0, 1)
if choix_sorts_20561 == 0 then
pUnit:RegisterEvent('spell0_20561', 1, 1)
end
if choix_sorts_20561 == 1 then
pUnit:RegisterEvent('spell1_20561', 1, 1)
end
end

function mob20561_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20561', math.random(1500, 3000), 1)
end

function mob20561_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20561_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20561_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20561, 1, 'mob20561_Action')
RegisterUnitEvent(20561, 2, 'mob20561_Leave')
RegisterUnitEvent(20561, 3, 'mob20561_Kill')
RegisterUnitEvent(20561, 4, 'mob20561_Die')
